

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet Filter implementation class MyFilter
 */
public class MyFilter implements Filter {

    /**
     * Default constructor. 
     */
    public MyFilter() {
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see Filter#destroy()
	 */
	public void destroy() {
		// TODO Auto-generated method stub
	}

	/**
	 * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
	 */
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		// TODO Auto-generated method stub
		// place your code here
/*		System.out.println("before entering the Filter");
		
		HttpServletRequest req = null;
		HttpServletRequest request1 = (HttpServletRequest) req;
		HttpServletResponse res = null;
		HttpServletResponse response1 =  (HttpServletResponse) res;
		
		String refer = request1.getHeader("refer");
		
		
		if (refer == null || !refer.contains(request.getServerName())) {
			request1.getRequestDispatcher("images/users.png").forward(request1,response1);
		} else{  */
			// pass the request along the filter chain
			chain.doFilter(request, response);
	//	}
		
	}

	/**
	 * @see Filter#init(FilterConfig)
	 */
	public void init(FilterConfig fConfig) throws ServletException {
		// TODO Auto-generated method stub
	}

}
